import { CacheIdStatMap, IdStat } from "../model/Statistic";
import { defineStore } from "pinia";

const UseCacheIdStatMap = defineStore("idStatMap", {
  state() {
    const cacheIdStatMap = new CacheIdStatMap([], new Map<string, IdStat>(), []);
    return {
      cacheIdStatMap: cacheIdStatMap,
    };
  },
  actions: {
    setCacheIdStatMap: function (cacheIdStatMap: CacheIdStatMap) {
      // console.log("surfaceSetting", surfaceSetting);
      // console.log('surfaceSetting',...surfaceSetting)
      this.getCacheIdStatMap().setInfo(cacheIdStatMap);
      // this.surfaceSetting.setInfo(...surfaceSetting);
      // this.setting = setting;
    },
    getCacheIdStatMap: function (): CacheIdStatMap {
      return this.cacheIdStatMap;
    },
    // getTaskLogMap:function(timeStamp:number):CacheTaskLogMap{
    //   // todo
    //
    // },
    setCacheIdStatList: function (cacheIdStatList: Array<string>) {
      this.cacheIdStatMap.cacheIdStatList = cacheIdStatList;
    },
    // save2:function(){
    //
    // },
  },
  getters: {},
});
export default UseCacheIdStatMap;
